{extend name="../../base/view/common/base" /}
<!-- 主体 -->
{block name="body"}
<style>
    .layui-laydate-header{
        display: none;
    }
    .layui-laydate-content> table>thead{
        display: none;
    }
    .laydate-day-prev{
        display: none;
    }
    .laydate-day-next{
        display: none;
    }
</style>
<form class="layui-form p-4">
    <h3 class="pb-3">功能菜单/节点</h3>
    <table class="layui-table layui-table-form">
        <tr>
            <td class="layui-td-gray-2">企业名<font>*</font>
            </td>
            <td>
                <input type="text" name="name" value="{$detail.name|default=''}" lay-verify="required" autocomplete="off" placeholder="请输入名称"
                       lay-reqText="请输入企业名称" class="layui-input">
            </td>
            <td class="layui-td-gray">ip<font>*</font>
            </td>
            <td>
                <input type="text" name="ip" value="{$detail.ip|default=''}" lay-verify="required" autocomplete="off" placeholder="请输入名称"
                       lay-reqText="请输入ip" class="layui-input">
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">数据库名称<font>*</font>
            </td>
            <td>
                <input type="text" name="databaseName" value="{$detail.databaseName|default=''}" lay-verify="required" autocomplete="off" placeholder="请输入名称"
                       lay-reqText="请输入数据库名称" class="layui-input">
            </td>
            <td class="layui-td-gray">用户名<font>*</font>
            </td>
            <td>
                <input type="text" name="username" value="{$detail.username|default=''}" lay-verify="required" autocomplete="off" placeholder="请输入名称"
                       lay-reqText="请输入用户名" class="layui-input">
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">数据库密码<font>*</font>
            </td>
            <td>
                <input type="text" name="password" value="{$detail.password|default=''}" lay-verify="required" autocomplete="off" placeholder="请输入名称"
                       lay-reqText="请输入数据库密码" class="layui-input">
            </td>
        </tr>
    </table>
    <div class="py-3">
        <input type="hidden" name="id" value="{$id}">
        <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
    const moduleInit = ['tool'];
    function gouguInit() {
        var form = layui.form,tool=layui.tool,level=0,laydate = layui.laydate;
        //监听提交
        form.on('submit(webform)', function (data) {
            let callback = function (e) {
                layer.msg(e.msg);
                if (e.code == 0) {
                    setTimeout(function(){
                        parent.parent.location.reload();
                    },1000);
                }
            }
            tool.post("{:url('add')}", data.field, callback);
            return false;
        });
        laydate.render({
            elem: '#gz_day' ,// 指定元素
            type:'date',
            format:'d'
        });
    }
</script>
{/block}
<!-- /脚本 -->